home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-05-20 | 1.2 KB | 63 lines | [TEXT/MPS ] |
- #include <Types.h>
- #include <QuickDraw.h>
- #include <Fonts.h>
- #include <Events.h>
- #include <Controls.h>
- #include <Windows.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <Dialogs.h>
- #include <Desk.h>
- #include <Scrap.h>
- #include <ToolUtils.h>
- #include <Memory.h>
- #include <SegLoad.h>
- #include <Files.h>
- #include <OSUtils.h>
- #include <Traps.h>
- #include <StdLib.h>
-
- #include "TDocument.h"
- #include "DisplList.h"
- #include "ListDoc.h"
-
- // create and delete the document window
-
- TListDoc::TListDoc(short resID) : (resID)
- {
- fObjList = new TObjList();
- ShowWindow(fDocWindow);
- }
-
- TListDoc::~TListDoc(void)
- {
- delete fObjList;
- HideWindow(fDocWindow);
- }
-
- void TListDoc::DoUpdate(void)
- {
- BeginUpdate(fDocWindow); // this sets up the visRgn
- if ( ! EmptyRgn(fDocWindow->visRgn) ) // draw if updating needs to be done
- {
- DrawWindow();
- }
- EndUpdate(fDocWindow);
- }
-
- // Draw all objects contained in the list.
-
- void TListDoc::DrawWindow(void)
- {
- TObjLink* temp;
-
- SetPort(fDocWindow);
- EraseRect(&fDocWindow->portRect);
-
- if (fObjList->NumObjs() != 0)
- for (temp = fObjList->Header();
- temp != nil; temp = temp->GetNext())
- temp->GetmyObj()->Draw(temp->GetmyObj()->GetObjPat());
- } // DrawWindow
-
-